package com.google.code.jmarias.common;

import javax.xml.bind.annotation.XmlRootElement;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 *
 *
 * Sice by mela byt abstraktni, ale kvuli serializaci neni. Prenasi se totiz
 * podtrida ze serveru, ale na clientovi staci se na ni divat jako na AbstractUser
 * @author Ondrej Michal
 */
@XmlRootElement
public class AbstractUser {

    private static Log log = LogFactory.getLog(AbstractUser.class);

    private String username;

    public AbstractUser() {
    }

    public AbstractUser(String username) {
        this.username = username;
    }

    @Override
    public String toString() {
        return "hrac " + username;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final AbstractUser other = (AbstractUser) obj;
        if ((this.username == null) ? (other.username != null) : !this.username.equals(other.username)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 59 * hash + (this.username != null ? this.username.hashCode() : 0);
        return hash;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

}
